<template>
	<gui-page ref="guipage">
		<view slot="gBody">
			<view class="top" v-if="dataObj.img">
				<image :src="dataObj.img" mode="widthFix" style="width: 100%;height: auto;"></image>
			</view>
			<view class="con">
				<view class="detail">
					<jyf-parser :html="dataObj.content" ref="article"></jyf-parser>
				</view>
			</view>
		</view>
	</gui-page>
</template>

<script>	
	export default {
		data() {
			return {
				type:'',
				dataObj: {}
			}
		},
		onLoad(options) {
			this.type = options.type?options.type:2
			this.getData()
			let title = options.type==2?'服务协议':'隐私政策'
			uni.setNavigationBarTitle({
				title
			})
		},
		methods: {
			getData() {
				this.$http.get('/api/protocol', {
					type: this.type
				}).then(res => {
					let result = res.data
					console.log('', result)
					this.dataObj = result
					this.dataObj.content = this.$u.richImg(result.content)
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		background: #fff;
	}

	.detail {
		padding: 31rpx 67rpx;
		line-height: 40rpx;
	}
</style>